package com.wcgksoft.common.util.Datacollection;
/**
 * 16进制转换为十进制
 */
import java.util.Scanner;

public class UtilHexToTen {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String hex_num = in.nextLine();
		long dec_num = Long.parseLong(hex_num, 16);
		System.out.println(dec_num);
		}
	
	public static String decimalToHex(int decimal) { 
	    String hex = ""; 
	    while(decimal != 0) { 
	        int hexValue = decimal % 16; 
	        hex = toHexChar(hexValue) + hex; 
	        decimal = decimal / 16; 
	    } 
	    return  hex; 
	} 
	 //将0~15的十进制数转换成0~F的十六进制数 
    public static char toHexChar(int hexValue) { 
        if(hexValue <= 9 && hexValue >= 0) 
            return (char)(hexValue + '0'); 
        else 
            return (char)(hexValue - 10 + 'A'); 
    } 
}

